Treat empty/comment-only YAML configs as empty list silently#71
Merged
Conversation
yaml.safe_load returns None for files containing only comments — which is exactly what `datasight generate` writes for time_series.yaml when no timestamp candidates are detected. The list-shape check was then warning on every load. Treat None as an empty list (silent) at all five list-loader sites; keep warning for genuinely wrong shapes like a top-level mapping. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (60.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
==========================================
- Coverage 86.86% 86.84% -0.03%
==========================================
Files 61 61
Lines 11552 11562 +10
==========================================
+ Hits 10035 10041 +6
- Misses 1517 1521 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
github-actions Bot
pushed a commit
that referenced
this pull request
May 10, 2026
Treat empty/comment-only YAML configs as empty list silently
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
yaml.safe_loadreturnsNonefor files containing only comments — which is exactly whatdatasight generatewrites fortime_series.yamlwhen no timestamp candidates are detected (data_profile.py:1641-1649).config.py:439then loggedWARNING | datasight.config - Expected a list in .../time_series.yaml, got NoneTypeon every load. Hit on everydatasight askafter a generate.data is Noneas an empty list (silent) at all five list-loader sites:queries.yaml,measures.yaml,time_series.yaml,joins.yamlinconfig.py, plusvalidation.yamlinvalidation.py. Keep warning for genuinely wrong shapes like a top-level mapping.Test plan
test_load_time_series_config_comment_only_is_silentreproduces the user's exact scenario and asserts the warning is not emitted.test_load_time_series_config_non_listto assert the warning is still emitted for the wrong-shape case (foo: barat the top level).pytest tests/test_config_extra.py tests/test_config.py— 45 passed.prek run --all-files— clean.🤖 Generated with Claude Code